import { ActionType } from '@ant-design/pro-components';
import { useRef, useState } from 'react';

/*
 * @Date: 2025-06-18 15:29:20
 * @Auth: 463997479@qq.com
 * @LastEditors: 463997479@qq.com
 * @LastEditTime: 2025-09-23 16:05:38
 * @FilePath: \corpus\src\models\useTree.ts
 */
export default () => {
  const [name, setName] = useState('');
  const [selectedKeys, setSelectedKeys] = useState([]);

  const [jsonData, setJsonData] = useState<any>(null);
  const [url, setUrl] = useState<string>('');
  const [type, setType] = useState<string>('');
  const [jsonViewVisible, setJsonViewVisible] = useState<boolean>(false);
  const [mdVisible, setMdVisible] = useState<boolean>(false);
  const [modalKnowledgeVisible, setModalKnowledgeVisible] = useState(false);

  const [viewVisible, setViewVisible] = useState<boolean>(false);
  const actionRef = useRef<ActionType>(null);
  const onChangeText = (callback: () => void) => {
    callback?.();
  };
  return {
    name,
    setName,
    setSelectedKeys,
    selectedKeys,
    actionRef,
    setViewVisible,
    url,
    type,
    jsonViewVisible,
    setUrl,
    setType,
    setJsonViewVisible,
    viewVisible,
    modalKnowledgeVisible,

    setModalKnowledgeVisible,
    jsonData,
    setJsonData,
    mdVisible,
    setMdVisible,

    onChangeText,
  };
};
